<template>
  <view class="cartInfo">
    <!-- 购物车列表项 
    [{"goods_id":57441,"goods_name":"创维(Skyworth) G7 4K超高清彩电HDR 智能网络液晶平板电视(玫瑰金) 65G7 (65英寸)","goods_price":9699,"goods_count":19,"goods_small_logo":"http://image2.suning.cn/uimg/b2c/newcatentries/0000000000-000000000168415104_1_400x400.jpg","goods_state":true}]-->
  <view class=""></view>
  <!-- 单选按钮  -->
  <view class="cartradio">
     <radio  :checked="goods.goods_state" color="#f10250" @click="radioChange()"/><text></text>
  </view>
  <!-- 图片区域 -->
  <view class="cartImage">
    <image :src="goods.goods_small_logo"></image>
  </view>
  <!-- 右边文字区域 -->
  <view class="cart-right">
    <!-- 右上区域 -->
    <view class="cart-right-top">
      <text>{{goods.goods_name}}</text>
    </view>
    <!-- 右下区域 -->
    <view class="cart-right-bottom">
      <!-- 右下左边价格区域 -->
      <view class="">
        <text>￥{{goods.goods_price}}</text>
      </view>
      <!-- 右下右数量区域 -->
      <view class="">
      <uni-number-box :min="1" :value="goods.goods_count" @change="cartnum"></uni-number-box>
      </view>
      
    </view>
  </view>
  </view>
</template>

<script>
  export default {
    name:"mycartInfo",
    props:['goods'],
    data() {
      return {
       
      };
    },
    methods:{
      radioChange(){
      const  goodInfo={
          goods_id:this. goods.goods_id,
          goods_state:!this.goods.goods_state
        }
        this.$emit('change_radio',goodInfo)
       
        
      },
      cartnum(e){
        const goodsInfo={
           goods_id:this. goods.goods_id,
          goods_count:+e
        }
        this.$emit('numchange',goodsInfo)
      }
    }
  }
</script>

<style lang="scss">
.cartInfo{
  padding: 10px;
  display: flex;
  .cartradio{
    display: flex;
    align-items: center;
  }
  justify-content: space-between;
  .cartImage{
    image{
      width:100px;
      height: 100px;
      padding-right: 10px;
    }
  }
  .cart-right{
    display: flex;
    flex-direction:column ;
    justify-content: space-between;
    .cart-right-top{
      font-size: 12px;
    
    }
    .cart-right-bottom{
      color: #f10250;
      display: flex;
      justify-content: space-between;
    }
  }
  
}
</style>
